package com.cheifsteam.springframework.context.support;

import com.cheifsteam.springframework.beans.factory.support.DefaultListableBeanFactory;
import com.cheifsteam.springframework.beans.factory.xml.XmlBeanDefinitionReader;

/**
 * @author 屈燃希
 * @date 2025/1/30 16:44
 * @content
 */
public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext{
    @Override
    protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) {
        XmlBeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory,this);
        String[] configLocations = getConfigLocations();
        if (configLocations != null){
            beanDefinitionReader.loadBeanDefinitions(configLocations);
        }
    }
    protected abstract String[] getConfigLocations();
}
